<a href="{:url('addfenlei')}" class="layui-btn">新建分类</a>




<table class="layui-table edit-table" lay-data="{cellMinWidth: 80,
    url:'{:url('getfenlei')}',page: true,totalRow:true
    }" lay-filter="edit-table" data-url="{:url('editfenlei')}" data-key="id">
    <thead>
    <tr>
        <th lay-data="{field:'id', width:80, sort: true}">id</th>
        <th lay-data="{toolbar:'#image',  sort: true}">分类图片</th>
        <th lay-data="{field:'name', sort: true,edit:'text'}">分类名称</th>
        <th lay-data="{field:'sort_order',edit:'text'}">排序（数值越大越靠前）</th>
        <th lay-data="{toolbar:'#show'}">是否禁用</th>
        <th lay-data="{toolbar:'#hot'}">设为热门</th>
        <!--<th lay-data="{toolbar:'#status'}">买家信息</th>-->
        <th lay-data="{toolbar: '#manipulate', width:200}">操作</th>
    </tr>
    </thead>
</table>
<script type="text/html" id="image">

    <img src="{{d.image}}" alt="">
</script>
<script type="text/html" id="show">
            <input lay-filter="switchAjax" {{#  if(d.status==0){ }} checked="" {{#  } else { }} {{#  } }} data-url="{:url('fenlei')}?type=2&id={{d.id}}" type="checkbox" checked="" name="open" lay-skin="switch" lay-text="显示|隐藏">

</script>
<script type="text/html" id="hot">

    <input lay-filter="switchAjax" {{#  if(d.is_hot==0){ }} checked="" {{#  } else { }} {{#  } }} data-url="{:url('fenlei')}?type=1&id={{d.id}}"  type="checkbox"  name="open" lay-skin="switch" lay-text="显示|隐藏">

</script>

<script type="text/html" id="manipulate" >
    <a href="{:url('delectfenlei')}?id={{d.id}}" class="layui-btn layui-btn-sm layui-btn-danger ajax-delete" data-url="" data-msg="您确定要删除么？">删除</a>
    <a href="{:url('secoundfenlei')}?id={{d.id}}" class="layui-btn layui-btn-sm">查看二级分类</a>
</script>
